package ink.xiaobaibai.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import ink.xiaobaibai.common.TimedTask;
import ink.xiaobaibai.common.TimedTaskHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author xiaobaibai
 * @since 2021-06-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("buy_timed_task")
@NoArgsConstructor
public class BuyTimedTask implements Serializable {

    private static final long serialVersionUID = 1L;

    public BuyTimedTask(Integer deviceId) {
        this.deviceId = deviceId;
    }

    /**
     * 购买机器定时任务
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 机器id
     */
    @TableField("device_id")
    private Integer deviceId;

    /**
     * 是否生效中
     */
    @TableField("open")
    private Boolean open;

    /**
     * 任务json串
     */
    @TableField(value = "timed_task", typeHandler = TimedTaskHandler.class)
    private TimedTask timedTask;


}
